package com.youbug.kefu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.youbug.kefu.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * <p>
 * 机构表
 * </p>
 *
 * @author youbug
 * @since 2023-03-02
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="Org对象", description="机构表")
public class Org extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "机构ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "父ID")
    private Integer pid;

    @ApiModelProperty(value = "机构名")
    private String name;

    @ApiModelProperty(value = "所有父ID，|分割")
    private String fullPid;

    @ApiModelProperty(value = "所有父机构名，|分割")
    private String fullPname;

    @ApiModelProperty(value = "机构层级")
    private Integer level;

    @TableField(exist = false)
    private List<Org> children;

}
